home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shw_bucketdevice.cog < prev    next >
Text File  |  1999-11-15  |  12KB  |  328 lines

  1. # Jones 3D Cog Script
  2. #
  3. # shw_bucketdevice.cog
  4. #
  5. # Sluiceway Alternating Script
  6. #
  7. # [CMG]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11. symbols
  12.  
  13.         message         startup
  14.         message         activated
  15.         message         user0
  16.         message         user1
  17.         message         timer
  18.         message         pulse
  19.         
  20.         thing           bucket0        nolink
  21.         thing           player                  local
  22.         thing           activatetarget          
  23.         thing           splashitem            local          
  24.  
  25.         thing            indy            nolink
  26.         thing            camera
  27.         thing            camtarget
  28.         thing            keypos
  29.         
  30.         thing            keyitem                 local
  31.         thing            spraystart
  32.         thing            sprayloop
  33.         thing            sprayend
  34.         
  35.         thing           bucketsprayitem             local
  36.         thing           bucketspraypos
  37.         thing            splashring        local
  38.  
  39.         surface         splashsurf
  40.         
  41.         cog             troopcog            
  42.         cog                hintcog
  43.  
  44.  
  45.         material        sprayskin=shw_a4water_spout.mat        local
  46.         material        startskin=spray_a4mth_beg.mat        local
  47.         material        loopskin=spray_a4mth_loop.mat        local
  48.         material        endskin=spray_a4mth_end.mat        local
  49.         
  50.         
  51.         material        splashdown=shw_floor_puddle_v2.mat    local
  52.         
  53.         flex            fps=8.0            local
  54.         
  55.         keyframe        rotate=shw_scoop_bukt.key   local   
  56.         keyframe        pull=in_turn_crank1.key   local   
  57.         keyframe        turnbd=in_turn_bd_stand_crank1.key   local   
  58.         keyframe        standbd=in_stand_bd_turn_crank1.key   local   
  59.                                                              
  60.         sound           crankmove=shw_crank_turn.wav            local
  61.         sound           drybuckhit=shw_bucket_hit_dry.wav       local
  62.         sound           wetbuckhit=shw_bucket_hit_water.wav     local
  63.         sound           bucktscoop=shw_bucket_scoop.wav         local
  64.         sound           splash=shw_water_spill.wav              local
  65.         sound           keydrop=shw_key_drop.wav                local
  66.  
  67.         vector          direction1      local
  68.         vector          splashstart      local
  69.         vector          splashend      local
  70.         
  71.         template        key       
  72.         template        fountainspray       
  73.         template        bucketspray       
  74.         template        splashmist       
  75.         template        ring=+ripples    local       
  76.         
  77.     int    curCam        local
  78.     int    thaw=0        local
  79.     int    keymade=0    local
  80.     int    keysize        local
  81.         
  82.         
  83.     int    crankloop       local
  84.     int    splashloop      local
  85.  
  86. end
  87. # ========================================================================================
  88.  
  89. code
  90.  
  91. startup:
  92.  
  93.         player = GetLocalPlayerThing();
  94.         SetThingFlags(spraystart, 0x80000);
  95.         SetThingFlags(sprayloop, 0x80000);
  96.         SetThingFlags(sprayend, 0x80000);
  97.         splashstart    = VectorSet(0.05, 0.05, 0.5);
  98.         splashend    = VectorSet(0.15, 0.15, 0.0);
  99.         
  100.         
  101. return;
  102.  
  103. #----------------------------------------------------------------------------------                
  104.  
  105. activated:
  106.  
  107.         // Remember the current camera
  108.             curCam = GetCurrentCamera();
  109.             # SET UP THE ACTOR WITH CORRECT WEAPONS
  110.             CopyPlayerHolsters(player, indy);
  111.  
  112.         If ((Getsenderref() == activatetarget) && (thaw == 1))
  113.         {
  114.             SetActorFlags(player, 0x200000);
  115.             SetTimerEx(0.1,1, 0,0);             //take cam and start anims    
  116.             SetTimerEx(2.3, 2, 0, 0);          //camera moves
  117.             SetTimerEx(1.5, 3, 0, 0);          //bucket spray gen  scoop sound
  118.             SetTimerEx(1.75,4, 0, 0);           //destroy bucketspry, 
  119.             SetTimerEx(2.95, 5, 0, 0);          //2nd bucket spray scoop sound  fountain gen
  120.             SetTimerEx(3.75, 6, 0, 0);           //destroy 2nd bucktspray  
  121.             SetTimerEx(6.0, 7, 0, 0);          //bounce key, destroy fountspray, return player control
  122.         }
  123.         
  124.         else if ((GetSenderref() == activatetarget) && (thaw == 0))
  125.         {
  126.             SetActorFlags(player, 0x200000);
  127.             SetTimerEx(0.1, 8, 0,0);             //take cam and start anims    
  128.             SetTimerEx(1.25, 9, 0, 0);          //camera moves first bucketsound
  129.             SetTimerEx(2.25, 10, 0, 0);          //second bucket sound
  130.             SetTimerEx(2.25, 11, 0, 0);           //return control
  131.             
  132.         }
  133.  
  134. return;
  135. #=================================================================
  136. timer:        
  137.                 
  138.          
  139.          If (GetSenderID() == 1)       //take cam and start anims
  140.          {
  141.             // Disable and hide player
  142.             SetThingFlags(player, 0x80000);
  143.             
  144.             // Cut to cutscene camera
  145.             SetCameraFocus(2, camera);
  146.             SetCamerasecondaryFocus(2, camtarget);
  147.             SetCameraFOV(FOV, 0, 0.0);
  148.             ClearThingFlags(indy, 0x80000);
  149.             SetCurrentCamera(2);
  150.             
  151.             // Play the animations - wait for Indy's
  152.             PlayKey(indy, standbd, 4, 0x12, 1);
  153.             PlayKey(bucket0, rotate, 4, 0x12, 0);
  154.             PlaySoundLocal(crankmove, 0.5, -1, 0x0, 0);
  155.             PlaySoundLocal(bucktscoop, 0.75, -1, 0x0, 0);
  156.             PlayKey(indy, pull, 4, 0x12, 1);
  157.             PlayKey(indy, turnbd, 4, 0x12, 1);
  158.          }
  159.                         
  160.          else
  161.          If (GetSenderID() == 2)         //camera moves
  162.               {
  163.                  
  164.                  movetoframe(camtarget, 1, 1);
  165.                  
  166.               }
  167.          
  168.          else
  169.          If (GetSenderID() == 3)          //bucket spray gen
  170.               {
  171.                
  172.                   //create water spray from bucket
  173.                   bucketsprayitem = CreateThing(bucketspray, bucketspraypos);
  174.                   capturething(bucketsprayitem);
  175.                   PlaySoundLocal(wetbuckhit, 1.0, 1, 0x0, 0);
  176.                   PlaySoundLocal(bucktscoop, 0.75, -1, 0x0, 0);
  177.               }
  178.                                                                 
  179.          else
  180.          If (GetSenderID() == 4)     //destroy bucketspry
  181.               {
  182.                  destroything(bucketsprayitem);
  183.               }
  184.                                     
  185.           else
  186.           If (GetSenderID() == 5)         //2nd bucket spray destroy first bucketspray            
  187.                {
  188.                   //create water spray from mouth
  189.                   ClearThingFlags(spraystart, 0x80000);
  190.                   SetMaterialCel(startskin, 0);
  191.                   materialanim(startskin, 8, 0);
  192.                   PlaySoundLocal(splash, 0.85, 1, 0x0, 0);
  193.                   SetPulse(0.1);    #particle splash created on every pulse
  194.                   //create water spray from bucket
  195.                   bucketsprayitem = CreateThing(bucketspray, bucketspraypos);
  196.                   CaptureThing(bucketsprayitem);
  197.                   PlaySoundLocal(bucktscoop, 0.75, -1, 0x0, 0);
  198.                   PlaySoundLocal(wetbuckhit, 1.0, 1, 0x0, 0);
  199.                }
  200.                
  201.           If (GetSenderID() == 6)        //destroy 2nd bucktspray, create fount
  202.                {
  203.                   SetThingFlags(spraystart, 0x80000);   # hide spraystartitem
  204.                   #materialanim(startskin, 0, 0);        # end animation on spraystartitem texture
  205.                   
  206.                   ClearThingFlags(sprayloop, 0x80000);  # show sprayloopitem
  207.                   SetMaterialCel(loopskin, 0);
  208.                   materialanim(loopskin, 8, 1);              # start animation on sprayloopitem texture
  209.                   SetSurfaceMat(splashsurf, splashdown);
  210.                   
  211.                   destroything(bucketsprayitem);
  212.                   movetoframe(camera, 1, .5);
  213.                }   
  214.                         
  215.            If (GetSenderId() == 7)         //make key destroy fountspray, return player control
  216.                 {
  217.                    //create key
  218.                  if (keymade == 0)
  219.                     {
  220.                       keyitem = CreateThing(key, keypos);
  221.                       keysize=(GetThingMoveSize(keyitem));
  222.                       SetThingMoveSize(keyitem, 0.005);
  223.                       direction1 = VectorSet((-1), (0), (-.5));
  224.                       ApplyForce(keyitem, VectorScale(direction1, 0.015));
  225.                       keymade = 1;
  226.                       PlaySoundLocal(keydrop, 0.5, 1, 0x0, 0);
  227.                       SendMessage(troopcog, user0);
  228.                       SendMessage(hintcog, user0);
  229.                     }
  230.                    sleep(.1);
  231.                    SetThingFlags(sprayloop, 0x80000);
  232.                    
  233.                    ClearThingFlags(sprayend, 0x80000);
  234.                    SetMaterialCel(endskin, 0);
  235.                    materialanim(endskin, 8, 0);              # start animation on sprayloopitem texture
  236.                    Sleep(.25);
  237.                    SetThingFlags(sprayend, 0x80000);
  238.                    SetPulse(0);
  239.                    sleep(2);
  240.                    
  241.                    // Return control and camera to player
  242.                    SetThingFlags(indy, 0x80000);
  243.                    ClearThingFlags(player, 0x80000);
  244.                    ClearActorFlags(player, 0x200000);
  245.                    SetCurrentCamera(curCam);
  246.                    movetoframe(camera, 0, 50);
  247.                    movetoframe(camtarget, 0, 50);
  248.                    SetThingMoveSize(keyitem, keysize);
  249.                 }
  250.                 
  251.            If (GetSenderID() == 8)       //take cam and start anims for sluice dry
  252.                 {
  253.                    
  254.                    
  255.        
  256.                    // Cut to cutscene camera
  257.                    SetCameraFocus(2, camera);
  258.                    SetCamerasecondaryFocus(2, camtarget);
  259.                    SetCameraFOV(FOV, 0, 0.0);
  260.                    ClearThingFlags(indy, 0x80000);
  261.                    SetThingFlags(player, 0x80000);
  262.                    SetCurrentCamera(2);
  263.        
  264.                    // Play the animations - wait for Indy's  and play crank sound
  265.                    PlayKey(indy, standbd, 4, 0x12, 1);
  266.                    PlayKey(bucket0, rotate, 4, 0x12, 0);
  267.                    PlaySoundLocal(crankmove, 0.75, -1, 0x0, 0);
  268.                    PlayKey(indy, pull, 4, 0x12, 1);
  269.                    PlayKey(indy, turnbd, 4, 0x12, 1);
  270.                 }
  271.                 
  272.             If (GetSenderID() == 9)     //camera moves and first buckethit for sluice dry   
  273.                 {
  274.                    PlaySoundLocal(drybuckhit, 1.0, 1, 0x0, 0);
  275.                    movetoframe(camtarget, 1, 0.5);
  276.                 }
  277.                 
  278.             If (GetSenderID() == 10)     //second buckethit for sluice dry   
  279.                 {
  280.                    PlaySoundLocal(drybuckhit, 1.0, 1, 0x0, 0);
  281.                 }
  282.  
  283.             If (GetSenderID() == 11)     //return control to player   
  284.                 {
  285.                    //wait for the action and return control
  286.                    waitforstop(cameratarget);
  287.                    sleep(4);
  288.                    #SetCameraFocus(curCam, player);
  289.                    SetThingFlags(indy, 0x80000);
  290.                    ClearThingFlags(player, 0x80000);
  291.                    ClearActorFlags(player, 0x200000);
  292.                    SetCurrentCamera(curCam);
  293.                    movetoframe(camtarget, 0, 50);
  294.                 }
  295.  
  296.  
  297. ClearActorFlags(player, 0x200000);
  298. return;
  299.  
  300. #----------------------------------------------------------------------------------                
  301. pulse:
  302.  
  303. index = index + 1;
  304. splashitem = CreateThing(splashmist, sprayloop);
  305. If (index == 4)
  306. {
  307. splashring = CreateThing(ring, sprayloop);
  308. AnimateSpriteSize(splashring, splashstart, splashend, 0.5);
  309. index = 0;
  310. }
  311. return;
  312.  
  313. #----------------------------------------------------------------------------------                
  314. user0:
  315.  
  316.         thaw = 1;
  317.         
  318. return;
  319. #----------------------------------------------------------------------------------                
  320. user1:
  321.  
  322.         thaw = 0;
  323.         
  324. return;
  325. #----------------------------------------------------------------------------------                
  326.  
  327. end
  328.